import result from '/@utils/Axios.ts';

export function getChatHistory(params: any) {
    return result({
        url: `/api/chatbot/history/`,
        method: 'get',
        params
    });
}

export function chatbot_chat(params: any) {
    return result({
        url: `/api/chatbot/chat/`,
        method: 'post',
        data: params,
        timeout: 1000 * 60 * 30
    });
}

export function chatbot_rate(params: any) {
    return result({
        url: `/api/chatbot/rate/`,
        method: 'post',
        data: params,
    });
}

export function chatbot_conversations(params: any) {
    return result({
        url: `/api/chatbot/conversations/`,
        method: 'get',
        params,
    });
}

export function chatbot_conversation_delete(id: number) {
    return result({
        url: `/api/chatbot/conversations/${id}/`,
        method: 'delete',
        timeout: 1000 * 60 * 30,
    });
}

export function chatbot_conversation_update(id: number, params: any) {
    return result({
        url: `/api/chatbot/conversations/${id}/`,
        method: 'put',
        data: params,
        timeout: 1000 * 60 * 30
    });
}

export function chatbot_conversation_create(params: any) {
    return result({
        url: `/api/chatbot/conversations/`,
        method: 'post',
        data: params,
        timeout: 1000 * 60 * 30
    });
}

//会话id列表
export function conversationIds(params){
    return result({
        url:'/api/chatbot/conversation-ids/',
        method:'get',
        params:params
    })
}
